﻿<%@ Page Language="C#" MasterPageFile="~/QuanTri/Manager.master" AutoEventWireup="true" CodeFile="QuanLyTinTuc.aspx.cs" Inherits="QuanTri_QuanLyTinTuc" Title="Untitled Page" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head1" Runat="Server">
<link href="../CSS/FixItem.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" Runat="Server">
<div style="width: 100%; height: auto;">
        <div id="main_panel" style="width: 100%;">
            <div id="personal_content" style="padding: 10px; border: 1px solid #ccc">
                <div class="personal_top_text">
                   Quản lý tin tức
                </div>
               <%-- <div class="personal_style_form">
                    <span class="personal_laber">Chuyên mục</span>
                  <asp:DropDownList ID="ddlChuyenMuc" runat="server" Width="500px"></asp:DropDownList>
                 </div>
                <div class="personal_style_form">
                    <span class="personal_laber">Tiêu đề</span>
                    <asp:TextBox ID="txtTieuDe" runat="server" Width="500px"></asp:TextBox>
                    <asp:Label ID="lblMaTin" Visible="false" runat="server"></asp:Label>
                 </div>
                  <div class="personal_style_form">
                    <span class="personal_laber">Nội dung</span>
                 <span style="float:left;margin-left:5px;width:100%">
                   <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" Width="100%" Height="300px" BasePath="../fckeditor/">
                </FCKeditorV2:FCKeditor></span>
                 </div><br />
                 <div style="clear:both"></div><br />
                 <div class="personal_style_form">
                    <span class="personal_laber">Nội dung tóm tắt</span>
                    <asp:TextBox ID="txtTomTatND" runat="server" TextMode="MultiLine" Height="150px" Width="500px"></asp:TextBox>
                 </div>
                  <div class="personal_style_form">
                    <span class="personal_laber">Ngày đăng</span>
                    <asp:TextBox ID="txtNgayDang" runat="server" Width="500px"></asp:TextBox>
                   <asp:CalendarExtender ID="cld1" runat="server" TargetControlID="txtNgayDang" Format="dd/mm/yy"></asp:CalendarExtender>
                 </div>
                  <div class="personal_style_form">
                    <span class="personal_laber">Trạng thái hiển thị</span>
                   <asp:RadioButton  ID="rdoHienThi" runat="server" Text="Có" GroupName="rdo"/>
                   <asp:RadioButton ID="rdoKHienThi" runat="server" Text="Không" GroupName="rdo" />
                 </div>
                  <div class="personal_style_form">
                    <span class="personal_laber">Đường dẫn ảnh</span>
                    <asp:FileUpload ID="fulAnh" runat="server" />
                 </div>--%>
                 <table style="width: 100%; border: 1px solid #6495ED;" cellpadding="0" cellspacing="0">
        <tr>
            <td class="theten" style="width: 150px;">
                Tiêu đề:
            </td> &nbsp;&nbsp;
            <td class="dieukhien" style="height:25px">
                <asp:TextBox ID="txtTieuDe" runat="server" CssClass="Textbox" Width="500px"></asp:TextBox>
            &nbsp;</td>
            <asp:Label ID="lblMaTin" runat="server" Visible="false"></asp:Label>
        </tr>
        <tr>
            <td class="theten" style="height:25px">
                Chọn chuyên mục:
            </td> &nbsp;&nbsp;
            <td class="dieukhien"style="height:25px">
               <asp:DropDownList ID="ddlChuyenMuc" CssClass="Combobox" runat="server" Width="229px" 
                    AppendDataBoundItems="True" Height="25px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="theten">
                Ảnh đại diện:
            </td>
            <td class="dieukhien">
                <asp:FileUpload ID="fulAnh" runat="server" Width="216px" Height="25px" />
            </td>
        </tr>
        <tr>
            <td class="theten">
                Nội dung tóm tắt:
            </td> &nbsp;&nbsp;
            <td class="dieukhien">
                <asp:TextBox ID="txtTomTatND" CssClass="ND" runat="server" Height="58px" TextMode="MultiLine" Width="99%"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="theten">
                Nội dung:
            </td> &nbsp;&nbsp;
            <td class="dieukhien ND">
                <FCKeditorV2:FCKeditor ID="FCKeditor1" EditorAreaCSS="ND" runat="server" BasePath="../fckeditor/" Height="300px">
                </FCKeditorV2:FCKeditor>
                </td>
        </tr>
        <tr>
            <td class="theten">
                Ngày đăng:
            </td> &nbsp;&nbsp;
            <td class="dieukhien">
                <asp:TextBox ID="txtNgayDang" CssClass="cld" runat="server" Height="25px" Width="258px"></asp:TextBox>
               <asp:CalendarExtender ID="CalendarExtender1" TargetControlID="txtNgayDang" Format="dd/mm/yyyy" runat="server">
            </asp:CalendarExtender>
            </td>
            
        </tr>
        <tr>
            <td class="theten">
                Trạng thái đăng:
            </td> &nbsp;&nbsp;
            <td class="dieukhien">
                <asp:RadioButton ID="rdoHienThi" GroupName="Feedback" runat="server"
                    AutoPostBack="false" />Hiển Thị
                &nbsp;&nbsp;&nbsp;
                <asp:RadioButton ID="rdoKHienThi" GroupName="Feedback" runat="server" AutoPostBack="false"
                    />Không hiển thị
            </td>
        </tr>
    </table>
                  <div style="margin-left:230px;color:Red"><asp:Label ID="lblThongBao" runat="server"></asp:Label></div>
                  <div id="personalSubmit" class="personal_submit clearfix">
                    <asp:Button ID="btnThem" runat="server" Text="Thêm" CssClass="button_150" onclick="btnThem_Click" 
                           />&nbsp&nbsp&nbsp
                    <asp:Button ID="btnSua" runat="server" Text="Sửa" CssClass="button_150" onclick="btnSua_Click" 
                           />&nbsp&nbsp&nbsp
                    <asp:Button ID="btnXoa" runat="server" Text="Xóa" CssClass="button_150" onclick="btnXoa_Click" 
                           />&nbsp&nbsp&nbsp
                  </div><br />
                    <asp:GridView ID="grvtintuc" runat="server" AutoGenerateColumns="false" Width="100%"
                                AllowPaging="True" Height="28px" ShowFooter="True" PageIndex="7"
                          onselectedindexchanged="grvtintuc_SelectedIndexChanged" 
                    onpageindexchanging="grvtintuc_PageIndexChanging">
                                <Columns>
                                    <asp:TemplateField HeaderText="STT">
                                        <ItemTemplate>
                                        <center>
                                            <%# Container.DataItemIndex + 1 %></center>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                      <asp:TemplateField HeaderText="Chuyên mục">
                                        <ItemTemplate><center>
                                           <%#Eval("TenChuyenMuc")%></center>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Tiêu đề">
                                        <ItemTemplate>
                                        <center>
                                        <asp:Label ID="lblMaTin" runat="server" Visible="false" Text='<%#Eval("MaTin") %>'></asp:Label>
                                           <%#Eval("TieuDe") %></center>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Nội dung tóm tắt">
                                        <ItemTemplate><center>
                                           <%#Eval("TomTatNoiDung")%>
                                           </center>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                   <asp:TemplateField HeaderText="Hình ảnh">
                                      <ItemTemplate>
                                      <center>
                                        <asp:Image ID="img" CssClass="Ah" ImageUrl='<%#"~/Images/"+Eval("Anh") %>' Width="70%" runat="server" /></center>
                                      </ItemTemplate>                                   
                                   </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Ngày đăng">
                                      <ItemTemplate>
                                        <center>
                                          <%#Eval("NgayDang") %>
                                        </center>
                                      </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Trạng thái hiển thị">
                                        <ItemTemplate><center>
                                           <%#Eval("TrangThaiDang")%></center>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ShowSelectButton="True" SelectText="Chọn" HeaderText="Chọn" >
                                        <ControlStyle Font-Underline="True" ForeColor="Blue" />
                                    </asp:CommandField>
                                </Columns>
                                <HeaderStyle BackColor="#E4ECEF" Font-Bold="True" BorderColor="Blue" Height="30px" />
                                <PagerStyle BackColor="#E4ECEF" HorizontalAlign="Center" />
                                <RowStyle BackColor="#EFF3FB" />
                            </asp:GridView>
                     <br />
                 </div>
             </div>
        </div>           
</asp:Content>

